package org.naive.vstream.render;

import java.util.Deque;
import java.util.LinkedList;

public class QuadTreeStack {
	private final Deque<Quad> stack = new LinkedList<>();
	public QuadTreeStack() {
		push();
	}

	public Quad getHead() {
		return stack.peek();
	}
	
	public boolean incrementHead() {
		
		final Quad last = stack.pop();
		if (last.canIncrement()) {
			stack.push(last.increment());
			return true;
		}
		stack.push(last);
		return false;
	}
	
	
	public boolean isEmpty() {
		return stack.isEmpty();
	}
	
	public void push() {
		stack.push(Quad.values()[0]);
	}
	
	public void pop () {
		stack.pop();
	}
}
